doctype html
html(lang='en')
    head
        meta(charset='UTF-8')
        meta(name='viewport', content='width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0')
        meta(http-equiv='X-UA-Compatible', content='ie=edge')
        title 修改密码
        link(rel="icon" href="/Favicon.ico" type="image/x-icon")
        link(href='/stylesheets/changepassword.css', rel='stylesheet')
        script(src='javascripts/jQuery.js')
    body
        .content
            h2 修改密码
            input(type="hidden" id="hidden" item1=data)
            form(method="POST" onsubmit="return check(this)")
                input#username(type='text', name='Phone', placeholder='请输入用户名',autocomplete="off")
                input#oldpasword(type='password', name='oldpasword', placeholder='请输入旧密码' autocomplete="off")
                input#newpaw(type='password', name='newpaw', placeholder='请输入新密码' autocomplete="off")
                input#repeatpas(type='password', name='repeatpas', placeholder='再次输入新密码' autocomplete="off")
                input.changePassword(type='submit', value='修改密码')
script.
    if($("#hidden").attr("item1")===undefined){
    }else{
        alert($("#hidden").attr("item1"))
    }
    function check(form) {
        if (form.Phone.value == '') {
            alert("请输入用户帐号!");
            form.Phone.focus();
            return false;
        }
        if (form.oldpasword.value == '') {
            alert("请输入登录密码!");
            form.oldpasword.focus();
            return false;
        }
        if (form.newpaw.value == '') {
            alert("请输入新的登录密码!");
            form.newpaw.focus();
            return false;
        } else if (form.newpaw.value.length < 6 || form.newpaw.value.length > 20) {
            alert("密码长度应在6到20个字符之间！");
            matchResult = false;
            return false;
        }
        if (form.repeatpas.value == '') {
            alert("请再次输入新的登录密码!");
            form.repeatpas.focus();
            return false;
        }
        if (form.newpaw.value != form.repeatpas.value){
            alert("两次新密码不一样,请重新输入");
            return false;
        }
        return true;
    }